let a: Object = {}
let arr: Array<number> = [1, 2, 3]
let d1: Date = new Date()

//不利于复用
let user: {
  username: string;
  age: number;
} = {
  username: 'shindou',
  age: 18
}

user.username
user.age


interface User {
  username: string;
  age: number
}

let userObject: User = {
  username: 'hikaru',
  age: 16
}

userObject.username
userObject.age

let userObject1: User = {
  username: 'shindou',
  age: 17
}

userObject1.username
userObject1.age


class Person {
  constructor(public username: string, public age: number) {

  }
}

let person: Person = new Person("hikaru", 35)

interface AjaxOptions {
  url: string;
  method: string;
}

function ajax(options: AjaxOptions) { }

ajax({
  url: '/a',
  method: 'get'
})
